package com.juzipi.data.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.juzipi.data.model.Teacher;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author juzipi
 * @Date 2021/6/30 15:27
 * @Info
 */
public interface TeacherMapper extends BaseMapper<Teacher> {

    @Delete("delete from teacher order by id limit 10000")
    void deleteAll();

    @Update("update teacher t inner join (select * from teacher_age) as ss on t.id = ss.id set t.age = ss.age")
    void updateTeacher();

    @Select("select id from teacher limit #{limit} offset #{offset}")
    List<Long> selectSome(Integer limit, Integer offset);

    @Select("select id from teacher")
    List<Long> selectAllId();

}
